/**
 * 
 */
package com.sasis.webapp;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * @author wujx
 *
 */
public class ApplicationContextLoadListener  implements ServletContextListener {

	private static final long serialVersionUID = -2153378435692476097L;
		public void contextDestroyed(ServletContextEvent arg0) {
			// TODO Auto-generated method stub
			
		}
		public void contextInitialized(ServletContextEvent event) {
			ServletContext context = event.getServletContext();
			ApplicationContext ctx = WebApplicationContextUtils
			.getRequiredWebApplicationContext(context);
			ApplicationContextKeeper.init(ctx);
		}
}
